﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/admincp.Master" AutoEventWireup="true"
    CodeBehind="Tag.aspx.cs" Inherits="SES.CMS.AdminCP.Tag" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 89px;
        }
        .style2
        {
            width: 195px;
        }
        .style3
        {
            width: 134px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <h1 class="title">
                Danh sách Tag</h1>
            <div class="search">
                <fieldset class="fieldset">
                    <legend>Lọc hiển thị</legend>
                    <table width="100%">
                        <tr>
                            <td class="style1">
                                <h3>
                                    Vị trí</h3>
                            </td>
                            <td>
                                <asp:DropDownList ID="dropSort" runat="server" AutoPostBack="True" CssClass="dropDown"
                                   Width="150px" onselectedindexchanged="dropSort_SelectedIndexChanged">
                                    <asp:ListItem Selected="True" Text="Tất cả" Value="0" />
                                    <asp:ListItem Text="Header" Value="1" />
                                    <asp:ListItem Text="Footer" Value="2" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </div>
            <div id="gridview">
                <fieldset id="details" visible="true" class="fieldset" runat="server">
                    <div style="margin-top: 10px">
                        <asp:GridView ID="listDetail" runat="server" CssClass="tstyle1" Width="100%" AutoGenerateColumns="False"
                            EnableModelValidation="True" GridLines="None" AllowPaging="True" BackColor="White"
                            BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellSpacing="1" PageSize="20"
                            EmptyDataText="Dữ liệu trống !"  OnPageIndexChanging="listDetail_PageIndexChanging"
                            OnRowCommand="listDetail_RowCommand" 
                            onrowdeleting="listDetail_RowDeleting" >
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex+1 %>
                                    </ItemTemplate>
                                    <ItemStyle Width="5%" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="TagID" HeaderText="TagID" Visible="false"></asp:BoundField>
                                <asp:TemplateField HeaderText="Title">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTitle" runat="server" Text='<%#Eval("Title")%>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="15%" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Link">
                                    <ItemTemplate>
                                        <asp:Label ID="lblLink" runat="server" Text='<%#Eval("Link")%>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="15%" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Số thứ tự">
                                    <ItemTemplate>
                                        <asp:Label ID="lblOrderID" runat="server" Text='<%#Eval("OrderID")%>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="10%" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="10%" HeaderText="Thao tác" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="btnEdit" runat="server" CommandName="Select" CommandArgument='<%#Eval("TagID") %>' ImageUrl="~/AdminCP/images/edit_16x16.gif" />
                                        <asp:ImageButton ID="btnDelete" runat="server" CommandArgument='<%#Eval("TagID") %>'
                                            CommandName="Delete" ImageUrl="~/AdminCP/images/delete_16x16.gif" OnClientClick="return confirm('Có muốn xóa bản ghi này? Nhấn OK để xóa!')" />
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </div>
                </fieldset>
            </div>
            <div>
                <table style="width: 100%">
                    <tr>
                        <td align="left" valign="top">
                            <asp:LinkButton ID="themmoi" runat="server" Text="Thêm mới" CssClass="button-gg-green"
                                OnClick="themmoi_Click" />&nbsp; &nbsp; &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
            <asp:Panel ID="pnInsert" runat="server">
                <fieldset id="Fieldset1" visible="true" class="fieldset" runat="server">
                    <legend>Thêm mới</legend>
                    <table style="width: 100%;">
                        <tr>
                            <td class="style3">
                                &nbsp;
                            </td>
                            <td class="style2">
                                <asp:Label ID="Label1" runat="server" Text="Title"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtTitle" runat="server" Height="23px" Width="250px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                                    ErrorMessage="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                &nbsp;
                            </td>
                            <td class="style2">
                                <asp:Label ID="Label2" runat="server" Text="Link"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtLink" runat="server" Height="23px" Width="250px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtLink"
                                    ErrorMessage="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                &nbsp;
                            </td>
                            <td class="style2">
                                <asp:Label ID="Label3" runat="server" Text="Số thứ tự"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtOrder" runat="server" Height="23px" Width="250px"></asp:TextBox>
                                <asp:FilteredTextBoxExtender ID="txtOrder_FilteredTextBoxExtender" FilterType="Numbers"
                                    runat="server" Enabled="True" TargetControlID="txtOrder">
                                </asp:FilteredTextBoxExtender>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                &nbsp;
                            </td>
                            <td class="style2">
                                <asp:Label ID="Label4" runat="server" Text="Vị trí"></asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlType" runat="server" Width="150px">
                                    <asp:ListItem Value="0">Chọn vị trí</asp:ListItem>
                                    <asp:ListItem Value="1">Header</asp:ListItem>
                                    <asp:ListItem Value="2">Footer</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                &nbsp;
                            </td>
                            <td class="style2">
                                <asp:LinkButton ID="lbtLuu" runat="server" Text="Lưu lại" CssClass="button-gg-green"
                                    OnClick="lbtLuu_Click" />
                                    <asp:LinkButton ID="lbtHuy" runat="server" Text="Hủy" CssClass="button-gg-green"
                                    OnClick="lbtHuy_Click" CausesValidation="False" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                    </fieldset>
            </asp:Panel>
            
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
